<template>
	<view class="container">
		<view class="list-cell b-b m-t" v-for="item in info.category" @click="navTo(item.id,item.name)" hover-class="cell-hover"
		 :hover-stay-time="50">
			<!--  -->
			<image class="image-icon" v-if="item.thumb!=null&&item.thumb!=''" :src="item.thumb" mode=""></image>
			<text class="cell-tit">{{item.name}}</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				info: {}
			};
		},
		onLoad() {
			this.$axios('index/main', 'POST', 'salemsg').then(res => {
				if (res.data.code == 200) {
					this.info = res.data.data;
				}
			})
		},
		methods: {
			// 跳转页面
			navTo(e,title) {
				uni.navigateTo({
					url: '../notice/module?cateid=' + e+'&title='+title
				})
			},
			//switch
			switchChange(e) {
				let statusTip = e.detail.value ? '打开' : '关闭';
				this.$api.msg(`${statusTip}消息推送`);
			},
		}
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
		overflow: hidden;
	}

	.list-cell {
		display: flex;
		align-items: center;
		padding: 10upx $page-row-spacing;
		line-height: 60upx;
		position: relative;
		background: #fff;
		justify-content: center;

		&.log-out-btn {
			margin-top: 40upx;

			.cell-tit {
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		&.m-t {
			margin-top: 16upx;
		}

		.cell-more {
			line-height: 80upx;
			align-self: baseline;
			font-size: $font-lg;
			color: $font-color-light;
			margin-left: 10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: $font-base;
			color: $font-color-light;
		}

		switch {
			transform: translateX(16upx) scale(.84);
		}
	}

	.image-icon {
		width: 80upx;
		height: 80upx;
		margin-right: 10upx;
	}
</style>
